home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CUCD / Programming / OUI / include / gadgets / cstring.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  1.3 KB  |  61 lines

  1. #ifndef CLASS_CSTRING_H
  2. #define CLASS_CSTRING_H
  3.  
  4. #ifndef EXEC_TYPES_H
  5. #include <exec/types.h>
  6. #endif
  7.  
  8. #if !defined( PLACETEXT_LEFT )
  9. #define PLACETEXT_LEFT  0x0001  /* Right-align text on left side */
  10. #endif
  11.  
  12. #ifndef CLASS_WINDOW_H
  13. class window ;
  14. #endif
  15.  
  16. #ifndef CLASS_GADGETLIST_H
  17. class gadgetlist ;
  18. #endif
  19.  
  20. #ifndef CLASS_GADGET_H
  21. #include "gadgets/gadget.h"
  22. #endif
  23.  
  24.  
  25. const char  INSIDECSTRING = 0 ;
  26. const char  RIGHTCSTRING = 1 ;
  27. const char  BOTTOMCSTRING = 2 ;
  28. const char  WIDTHCSTRING = 4 ;
  29. const char  HEIGHTCSTRING = 8 ;
  30.  
  31.  
  32. // ========================================================================
  33. // ==========================  CSTRING CLASS ==============================
  34. // ========================================================================
  35.  
  36.  
  37. class cstring : public gadget
  38. {
  39.     STRPTR      norm1 ;
  40.     STRPTR      norm2 ;
  41.     STRPTR      under ;
  42.  
  43.     IntuiText   *it1 ;
  44.     IntuiText   *it2 ;
  45.     IntuiText   *it3 ;
  46.  
  47.     TextFont    *font ;
  48.     TTextAttr   *underline ;
  49.     TTextAttr   *plain ;
  50. public:
  51.     cstring(gadgetlist *gl,
  52.             void (window::*func)(gadget *, unsigned long, unsigned short),
  53.             const char*t, const char* text, long border=FALSE, long place=PLACETEXT_LEFT,
  54.             char style=INSIDECSTRING) ;
  55.     ~cstring() ;
  56.     void set(const char *text) ;
  57.     void keystroke(BOOL shifted) ;
  58. };
  59.  
  60. #endif
  61.